home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / July 96 / Re Icons don't show up in the < prev    next >
Encoding:
Internet Message Format  |  1996-07-01  |  2.5 KB  |  [TEXT/ttxt]

  1. Subject:     Re: Icons don't show up in the menu
  2. Sent:        6/29/96 9:30 PM
  3. Received:    7/1/96 8:34 AM
  4. From:        Neal Williams, neal@corda.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. >>I have icons in my menu but they don't show up.
  9. >>
  10. >>My menus are in a mac resource file and I install them all using the
  11. >>'MyMenuBar->AddMenuLast()' method, but none of my icons will show.
  12. >>
  13. >>Is this because my resource file is out of scope when my menu comes
  14. >up?
  15. >
  16. >Yes.  This is also why balloon help for menus doesn't work with OpenDoc.  
  17. >The menu manager doesn't actually load the menus when the menu is 
  18. >created.  It loads them when drawing the menu.
  19. >
  20. >>How do I get them to show up?
  21. >
  22. >You can use the following technique:
  23. >
  24. >When you get and AdjustMenus call and you have the menu focus, call 
  25. >BeginUsingLibraryResources (or an equivalent routine if you're using ODF 
  26. >or something else). Store the reference number this call gives you in a 
  27. >field in your class.
  28.  
  29.  
  30. How can I do this using the ODF class FW_CSharedLibraryResourceFile for
  31. this? I've only seen it used to set up a scope within a method, not across
  32. methods.
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39. >
  40. >When you get the ensuing HandleEvent with a menu event, call 
  41. >EndUsingLibraryResources resources with that reference value.
  42. >
  43. >One of the clipboard recipes makes the statement that you will always
  44. >get 
  45. >a menu event after an AdjustMenus call, even if the mouse was released 
  46. >outside all the menus.  This is done so that you can acquire the 
  47. >clipboard focus in AdjustMenus and not give it up until after the menu 
  48. >event has been handled (so there's no way the clipboard could change on 
  49. >you).
  50. >
  51. >However, there's a bug in OpenDoc (I believe it's still incorrect in 
  52. >1.0.4, but it's reportedly fixed in the next version) where this doesn't 
  53. >happen for one case.  The case at fault is when there's a key event with 
  54. >the command-key down.  In this case, AdjustMenus is called before
  55. >trying 
  56. >to resolve the key command into a menu command.  However, if there is
  57. >no 
  58. >corresponding, enabled menu command you don't receive a menu event.
  59. >
  60. >To work around this, you can probably check your stored reference value 
  61. >in your key down event handling code as well as your menu event handling 
  62. >code.
  63. >
  64.  
  65. How do I check for a key down event in ODF? I can't find any HandleKey, or
  66. KeyDown methods that I can subclass, and my DoVirtualKey method is not
  67. called with some command key events.
  68.  
  69.  
  70. -Neal
  71.